A file server is a special-purpose computer adapted for attachment to a data network and programmed for providing clients with access to computer files. The file server is designed primarily to enable the rapid storage and retrieval of data in the files.
A conventional file server has limits on the total available storage capacity and also on the maximum number of files that can be stored at any given time. Due to these limits, a file system manager in the file server keeps a running count of the number of files presently stored in the file server and a running count of the total number of bytes of storage contained within the files. When the running counts approach the limits of the file server, the file system manager sends a warning message to an administrator so that the administrator may recover some free storage capacity by deleting files or moving files off of the file server to archival storage. If the administrator does not recover a sufficient amount of free storage, then clients of the file server may be denied service when the clients attempt to extend files or create new files.
A conventional file server also has the ability to set and enforce storage quotas per file system, per user, and per user group. For example, the file system manager computes a running count of the number of files in each file system, the number of files owned by each user, and the number of files owned by each group. The file system manager also computes a respective running count of the total number of bytes contained in the files of each file system, the total number of bytes contained in the files owned by each user, and the total number of bytes contained in the files owned by each user group. Each storage quota is a specified upper bound on such a running count of the number of files or total number of bytes. The file system manager enforces the storage quotas by denying a request to extend a file or to create a new file if grating the request would cause a quota to be exceeded.
Sometimes the running count mechanism is unavailable or inoperative for indicating the quota usage for a file system, a user, or a user group. For example, a running count may become lost or corrupted due to a hardware or software failure. The running count may also be unavailable if user or user group quotas are added to a file server that previously did not have user or user group quotas. If a running count is unavailable or inoperative, then the file system directory tree needs to be scanned in order to read the file attributes required for computing the quota usage. Such a scan of the file system directory tree and computation of the quota usage of the files in the directory tree is known as a quota check of the directory tree.
A conventional quota check of the directory tree requires the directory tree to be held “offline” for file access operations that change the quota usage of the files or that move the files. File access operations that change the quota usage include operations that create or delete files, or that extend or truncate files. File access operations that move the files include operations that rename files. During a conventional quota check, the file system has been held offline for such file access operations by “freezing” the file system during the quota check, or by unmounting the file system and remounting the file system as “read only” mode during the quota check. In either case, file access operations that write to the files have been blocked during the conventional quota check.